<?php
function my_substr($str,$n)
{
    //求字符中$str的长度

    $len=mb_strlen($str,'utf-8');

    if ($len>$n)
    {
        return mb_substr($str,0,$n,'utf-8')."...";
    }
    else
    {
        return $str;
    }
}
